package com.example.verification.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @author rcl
 * @date 2019/7/29 16:23
 */
@Component
public class StartUpRunConfig implements ApplicationRunner {
    @Autowired
    private RedisTemplate<String,Object> redisTemplate;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        System.out.println("启动完成时执行..............");
        redisTemplate.opsForValue().set("test","12321312");
        System.out.println(redisTemplate.opsForValue().get("test"));
    }
}
